﻿using Client.Framework.Message;
using Client.Model;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Message.Request
{
    class AddEditOrgReq : RequestBaseMessage
    {
        public AddEditOrgReq(int msgId) : base(msgId)
        {

        }

        public ViewOrg Org { get; set; }

        public override byte[] Serialize()
        {
            AddEditOrg msg = new AddEditOrg();
            if (Org != null)
            {
                Org org = new Org
                {
                    Id = Org.ID,
                    ParentId = Org.ParentId,
                    OrgName = Org.OrgName,
                    Status = (int)Org.Status,
                    Sort = Org.Sort
                };
                msg.Org = org;
            }
            return msg.ToByteArray();
        }
    }
}
